import { createRouter, createWebHistory } from 'vue-router'
//组件
import layout from '@/views/layout/index.vue'
import CategoryView from '@/views/category/index.vue'
import UserView from '@/views/user/index.vue'
import UserLoginView from '@/views/user/login.vue'
import IndexView from '@/views/index/index.vue'
import NursingProjectView from '@/views/nursingProject/index.vue'
import NursingLevel from '@/views/nursingLevel/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: layout,
      children: [
        { path: '/', redirect: '/index' },
        { path: '/index', name: 'index', component: IndexView },
        { path: '/category', name: 'category', component: CategoryView },
        { path: '/user', name: 'user', component: UserView },
        { path: '/nursingProject', name: 'nursingProject', component: NursingProjectView },
        { path: '/nursingLevel', name: 'nursingLevel', component: NursingLevel }
      ]
    }, { path: '/user/login', name: 'userLogin', component: UserLoginView },
  ]
})

export default router
